import request from '@/config/axios'
import type { TableData } from './types'

export const getTableListApi = (params: any): Promise<IResponse> => {
  return request.post({ url: 'http://localhost:8081/personnel/selDeptList', params })
}

export const saveTableApi = (params: Partial<TableData>): Promise<IResponse> => {
  return request.post({ url: 'http://localhost:8081/personnel/addDeptInfo', params })
}

export const saveTwoTableApi = (params: Partial<TableData>): Promise<IResponse> => {
  return request.post({ url: 'http://localhost:8081/personnel/updDeptInfo', params })
}

export const delTableListApi = (ids: string[] | number[]): Promise<IResponse> => {
  return request.post({ url: 'http://localhost:8081/personnel/lzrdelDeptInfo', data: { ids } })
}

export const getLzrupdDeptStatus = (params: any): Promise<IResponse> => {
  return request.post({ url: 'http://localhost:8081/personnel/lzrupdDeptStatus', params })
}

export const getNumber = (params: any): Promise<IResponse> => {
  return request.get({ url: 'http://localhost:8081/personnel/selReceptionNum', params })
}

export const getKefujilu = (params: any): Promise<IResponse> => {
  return request.get({ url: 'http://localhost:8081/personnel/selSmartAI', params })
}

export const delKefujilu = (id: string[] | number[]): Promise<IResponse> => {
  return request.post({ url: 'http://localhost:8081/personnel/delSmartAI', data: { id } })
}